﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FFMpegCore;
using FFMpegCore.Enums;

namespace CoreMembers.FileHelp
{
    public class FFMMediaHelp
    {
        /// <summary>
        /// 转码
        /// </summary>
        public static string Transcoding(string filePath, string outPutFile)
        {
            bool success = FFMpegArguments.FromFileInput(filePath)
                  .OutputToFile(outPutFile, true,
                  options => options.WithVideoCodec("libx264")
                  .WithAudioCodec("aac")
                  ).ProcessSynchronously();
            ;
            if (success) {
                return "ok";
            }
            else
            {
                return "fail";
            }
        }
    }
}
